#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int hammingDistance(int x, int y)
    {
        int ans = 0;
        for (int i = 0; i < 32; ++i)
        {
            int bit1 = (x >> i) & 1;
            int bit2 = (y >> i) & 1;
            if (bit1 != bit2) ++ans;
        }
        return ans;
    }
};